package com.s2015.doors.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.HibernateTemplate;

import com.s2015.doors.beans.User;
import com.s2015.doors.dao.IUserDao;

public class UserDaoImpl implements IUserDao {
	private HibernateTemplate hTem = null;

	public User getUserById(long id) {
		User load = hTem.load(User.class, id);
		return load;
	}

	public HibernateTemplate gethTem() {
		return hTem;
	}

	public void sethTem(HibernateTemplate hTem) {
		this.hTem = hTem;
	}

	@Override
	public void addUser(final User user) {
		hTem.save(user);
	}

}
